<template>
    <div>
        <!-- <p>主页面</p> -->
        <!-- <audio src="http://m701.music.126.net/20220521170144/a6255cd3379c5598d8cc17adb1cdf498/jdymusic/obj/wo3DlMOGwrbDjj7DisKw/14556678385/9b81/c537/3cd0/0557bbea3d08df5afa3f0cd521cfaf6e.mp3">111</audio> -->
        <MusicListView :mes="xxx" tit="新歌速递"></MusicListView>
        <MusicListView :mes="www" tit="mv热榜"></MusicListView>
        <MusicListView :mes="zzz" tit="新碟上架"></MusicListView>
        <br/>
        <br/>
    </div>
</template>
<script>
import axios from "axios";
import MusicListView from "./MusicListView";
export default {
    data() {
        return {
            www: [],
            zzz: [],
            xxx: [],
        };
    },
    components: {
        MusicListView,
    },
    mounted() {
        this.ajax();
        this.ajax1();
        this.ajax2();
    },
    methods: {
        ajax(url) {
            url = "http://121.41.51.182:3000/top/mv";
            return axios({
                method: "get",
                timeout: 1000 * 30,
                url: url,
                dataType: "json",
            })
                .then((res) => {
                    // console.log(res.data.data);
                    this.www = res.data.data;
                    // this.www.splice(9);
                    console.log(this.www);
                    return res.data.data;
                })
                .catch(function (error) {
                    alert("获取失败，请稍后重试");
                    console.log(error);
                });
        },
        ajax1(url) {
            url = "http://121.41.51.182:3000/top/album";
            console.log(123123);
            return axios({
                method: "get",
                timeout: 1000 * 30,
                url: url,
                dataType: "json",
            })
                .then((res) => {
                    // console.log(res.data.weekData);
                    this.zzz = res.data.weekData;
                    // this.zzz.splice(9);
                    console.log(this.zzz);
                    return res.data;
                })
                .catch(function (error) {
                    alert("获取失败，请稍后重试");
                    console.log(error);
                });
        },
          ajax2(url) {
            url = "http://http://121.41.51.182:3000/top/mv:3000/personalized/newsong";
            return axios({
                method: "get",
                timeout: 1000 * 30,
                url: url,
                dataType: "json",
            })
                .then((res) => {
                    this.xxx = JSON.parse(res.request.response).result;
                    // this.www.splice(9);
                    console.log(this.xxx);
                    return res;
                })
                .catch(function (error) {
                    alert("获取失败，请稍后重试");
                    console.log(error);
                });
        },
    },
};
</script>
